﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Text;
using PowerCreator.LMS.Web.Paper;
using PowerCreator.LMS.Web.Question;
using PowerCreator.LMS.Paper.Entiry;
using PowerCreator.LMS.Question.Entiry;
using PowerCreator.LMS.Common.Script;
using PowerCreator.LMS.Common.Utils;


public partial class web_PaperResearch_OpenPaperResearch : PowerCreator.LMS.Web.Base.WebBasePage
{
    protected PowerCreator.LMS.Web.Config.WebConfig config = new PowerCreator.LMS.Web.Config.WebConfig();
    const string NEWTEXT = "<input id={0} name={0}  type=\"text\" Class=\"myline\" value=\"{1}\" />";
    const string QEUSTIONINDEX = "<span class=\"font_bule\">【{0}】</span>";
    //ManagerPaperInfo objPaperInfoLogic = new ManagerPaperInfo();
    //ManagerUserPaperHistoryInfo objuserpaperhistorylogic = new ManagerUserPaperHistoryInfo();
    //ManagerPaperUserAnswer objpaperuseranswerlogic = new ManagerPaperUserAnswer();
    //ManagerQuestionInfo objquestioninfologic = new ManagerQuestionInfo();
    //ManagerQuestionOption objquesgioninfologic = new ManagerQuestionOption();
    //ManagerPaperQuestion paperquesgionlogic = new ManagerPaperQuestion();
    //ManagerPaperUserAnswerTempInfo objPaperUserAnswerTempLogic = new ManagerPaperUserAnswerTempInfo();
    //ManagerUserPaperUnPassHistoryInfo objManagerUserPaperUnPassHistoryInfo = new ManagerUserPaperUnPassHistoryInfo();
    //ManagerPaperConn objManagerPaperConn = new ManagerPaperConn();
    //ManagerSecurityUserInfo objManagerSecurityUserInfo = new ManagerSecurityUserInfo();

    //ManagerProjectSchedule manager = new ManagerProjectSchedule();

    //ManagerProjectHistoryInfo hidManager = new ManagerProjectHistoryInfo();

    ManagerPaper objManagerPaper = new ManagerPaper();
    ManagerQuestion objManagerQuestion = new ManagerQuestion();

    public string ispanduancz = "0";
    public string isdancz = "0";
    public string isgaiz = "0";
    public string isduocz = "0";
    public string istiancz = "0";
    public string isyuecz = "0";
    public string iswantcz = "0";
    public string iswangcz = "0";
    public string iscaocz = "0";
    public string iszuocz = "0";
    public int thi = 1;
    public int Question_tk_ID = 1;
    public int mincount = 0;//试卷测试时间

    public string jsTime = "";


    //protected override void InitPage()
    //{
    //    base.InitPage();
    //}
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Session["UserID"] == null)
        //{
        //    if (ViewState["UserID"] != null)
        //    {
        //        Session["UserID"] = ViewState["UserID"].ToString();
        //    }
        //    else
        //    {

        //        //Script.RedirectNewUrl(Utils.WebRoot + "/web/Login.aspx");
        //        //return;

        //    }
        //}
        if (Request.Params["timer"] != null)
        {
            string msg = Request.Params["timer"].ToString().Trim();
            if (msg == config.GetLanagerValueByKey("theme_Paper_Exam_Msg1", PowerCreator.LMS.Language.LanagetItemType.Page))
            {
                Save_Paper();
            }
        }

        if (!IsPostBack)
        {
            InitPage();

            string pid = Request.QueryString["PaperID"].ToString();

            ViewState.Add("PaperID", pid);


            PowerCreator.LMS.Web.Base.BasePage bpage = new PowerCreator.LMS.Web.Base.BasePage();
            ViewState["UserID"] = bpage.GetLoginEntity.UserID;

            DataTable dt_paperInfo = new DataTable();
            dt_paperInfo = objManagerPaper.QueryPaperResearch("PaperResearch_ID=" + ViewState["PaperID"].ToString());
            if (dt_paperInfo.Rows.Count == 0)
            {
                Script.Alert(this, "", config.GetLanagerValueByKey("theme_Paper_Delete_Msg", PowerCreator.LMS.Language.LanagetItemType.Page));
                return;
            }
            lab_PaperName.Text = dt_paperInfo.Rows[0]["PaperResearch_Name"].ToString();
            ViewState["PaperState"] = dt_paperInfo.Rows[0]["PaperResearch_SeeState"].ToString();
           


            #region 插入用户试卷考试记录信息表
            //string cmd = " FKUPRHistoryUserID=" + ViewState["UserID"].ToString() + " and FKUPRHistoryPaperID=" + ViewState["PaperID"].ToString();
            //DataTable dt_UserPaperHistory = objManagerPaper.QueryUserPaperResearchHistory(cmd);
            VOUserPaperResearchHistory objpaperhistoryinfo = new VOUserPaperResearchHistory();

            //if (dt_UserPaperHistory.Rows.Count == 0)
            //{

               
                objpaperhistoryinfo.FKUPRHistoryPaperID = int.Parse(ViewState["PaperID"].ToString());
                objpaperhistoryinfo.UPRHistoryStartTime = DateTime.Now;
                objpaperhistoryinfo.UPRHistoryEndTime = DateTime.MaxValue;
                objpaperhistoryinfo.UPRHistoryUpdateTime= DateTime.Now;
           
                objpaperhistoryinfo.FKUPRHistoryUserID = int.Parse(ViewState["UserID"].ToString());
                objpaperhistoryinfo.UPRHistoryUserIP = Request.UserHostAddress;
                objpaperhistoryinfo.UPRHistoryReadState = 0;
                
               

                objManagerPaper.CreateUserPaperResearchHistory(objpaperhistoryinfo);
            //}

            #endregion



            Band_dlst_panduan();//判断题

            BindDLti1();//单选

            BindDLti2();//多选

            BindDLti3();//填空
            BindDLti4();//名词解释
            BindDLti5();//简答
            //BindDL_zuhe();//组合题

        }

    }

    protected override void InitPage()
    {
        lab_PaperName.Text = GetLanageValueByKey("lab_EditUserPaper_PaperName", PowerCreator.LMS.Language.LanagetItemType.Page);


        lab_Panduan.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Panduanti", PowerCreator.LMS.Language.LanagetItemType.Page);
        lab_Danxuan.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Danxuanti", PowerCreator.LMS.Language.LanagetItemType.Page);
        lab_Duoxuan.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Duoxuanti", PowerCreator.LMS.Language.LanagetItemType.Page);
        lab_Tiankong.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Tiankongti", PowerCreator.LMS.Language.LanagetItemType.Page);
        lab_Mingcijieshi.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Mingcijieshiti", PowerCreator.LMS.Language.LanagetItemType.Page);
        lab_Jiandati.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Jiandati", PowerCreator.LMS.Language.LanagetItemType.Page);
        //lab_Zuheti.Text = GetLanageValueByKey("lab_EditUserPaper_Question_Zuheti", PowerCreator.LMS.Language.LanagetItemType.Page);

        //btn_Check.Text = GetLanageValueByKey("btn_OpenPaper_Check", PowerCreator.LMS.Language.LanagetItemType.Page);
        btnSave.Text = GetLanageValueByKey("btn_EditUserPaper_Submit", PowerCreator.LMS.Language.LanagetItemType.Page);

        base.InitPage();
    }

    private void Save_Paper()
    {
        int sumcount = 0;

        #region 提交判断题答案
        foreach (DataListItem sDataListItem in dlst_panduanti.Items)
        {
            RadioButtonList rbtl = (RadioButtonList)sDataListItem.FindControl("AnswerList1");
            bool isnull = false;
            for (int i = 0; i < rbtl.Items.Count; i++)
            {
                if (rbtl.Items[i].Selected == true)
                    isnull = true;
            }
            string xsans = string.Empty;
            if (isnull)
            {
                xsans = rbtl.SelectedItem.Text.ToString().Trim().Substring(0, 1);//获取选中值

            }

            Label LBdantiid = (Label)sDataListItem.FindControl("LBdantiid");
            string questionID = LBdantiid.Text.Trim();

            Label LBdanra = (Label)sDataListItem.FindControl("LBdanra");
            string rightans = LBdanra.Text.Trim();

            Label lab_Score = (Label)sDataListItem.FindControl("lab_Score");    //取得题目分数值
            if (xsans == rightans)
            {
                sumcount += int.Parse(lab_Score.Text);
            }
            else
            {
                sumcount += 0;
            }

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();

        
            
            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());
            
            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = xsans;
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
        }
        #endregion

        #region 提交单选题答案
        foreach (DataListItem oDataListItem in DLti1.Items)
        {
            RadioButtonList rbtl = (RadioButtonList)oDataListItem.FindControl("AnswerList1");
            bool isnull = false;
            for (int i = 0; i < rbtl.Items.Count; i++)
            {
                if (rbtl.Items[i].Selected == true)
                    isnull = true;
            }
            string xsans = string.Empty;
            if (isnull)
            {
                xsans = rbtl.SelectedItem.Text.ToString().Trim().Substring(0, 1);//获取选中值

            }


            Label LBdantiid = (Label)oDataListItem.FindControl("LBdantiid");
            string questionID = LBdantiid.Text.Trim();

            Label LBdanra = (Label)oDataListItem.FindControl("LBdanra");
            string rightans = LBdanra.Text.Trim();

            Label lab_Score = (Label)oDataListItem.FindControl("lab_Score");    //取得题目分数值
            if (xsans == rightans)
            {
                sumcount += int.Parse(lab_Score.Text);
            }
            else
            {
                sumcount += 0;
            }

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();



            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());

            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = xsans;
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
        }
        #endregion

        #region 提交多选题
        foreach (DataListItem pDataListItem in DLti2.Items)
        {
            CheckBoxList rbtl = (CheckBoxList)pDataListItem.FindControl("CheckList2");
            string xsans = "";
            for (int k = 0; k < rbtl.Items.Count; k++)
            {
                if (rbtl.Items[k].Selected)
                {

                    if (xsans != "")
                    {
                        xsans += "$" + rbtl.Items[k].Text.ToString().Trim().Substring(0, 1);
                    }
                    else
                    {
                        xsans += rbtl.Items[k].Text.ToString().Trim().Substring(0, 1);
                    }
                }
            }

            Label LBduotiid = (Label)pDataListItem.FindControl("LBduotiid");
            string questionID = LBduotiid.Text.Trim();
            Label LBduora = (Label)pDataListItem.FindControl("LBduora");
            string rightans = LBduora.Text.Trim();

            Label lab_Score = (Label)pDataListItem.FindControl("lab_Score");    //取得题目分数值
            if (xsans == rightans)
            {
                sumcount += int.Parse(lab_Score.Text);
            }
            else
            {
                sumcount += 0;
            }

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();



            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());

            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = xsans;
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
        }
        #endregion

        #region 提交填空题
        int questioncount = 1;
        foreach (DataListItem qDataListItem in DLti3.Items)
        {
            Label LBtktiid = (Label)qDataListItem.FindControl("LBtktiid");
            string questionID = LBtktiid.Text.Trim();


            StringBuilder UserAnswer = new StringBuilder();
            DataTable dt_question_tk = (DataTable)ViewState["dt_Question_tk"];
            int kongCount = int.Parse(dt_question_tk.Rows[0][questioncount].ToString());
            for (int i = 0; i < kongCount; i++)
            {
                string question_tk_ID = "newtext" + "_" + questioncount + "_" + i;
                if (i < kongCount - 1)
                {

                    UserAnswer.Append(Request.Params[question_tk_ID].ToString() + "$");
                }
                else
                {
                    UserAnswer.Append(Request.Params[question_tk_ID].ToString());
                }
            }

            questioncount += 1;
            Label LBtkra = (Label)qDataListItem.FindControl("LBtkra");
            string rightans = LBtkra.Text.Trim();

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();



            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());

            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = UserAnswer.ToString();
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
        }
        #endregion

        #region 名词解析
        foreach (DataListItem rDataListItem in DLti4.Items)
        {
            Label LBjdftiid = (Label)rDataListItem.FindControl("LBjdftiid");
            string questionID = LBjdftiid.Text.Trim();

            TextBox TBjd = (TextBox)rDataListItem.FindControl("TBjd");
            string jdans = TBjd.Text.Trim();

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();



            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());

            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = jdans;
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }

        }
        #endregion

        #region 提交简答题
        foreach (DataListItem tDataListItem in DLti5.Items)
        {
            Label LBjdftiid = (Label)tDataListItem.FindControl("LBjdftiid");
            string questionID = LBjdftiid.Text.Trim();

            TextBox TBjd = (TextBox)tDataListItem.FindControl("TBjd");
            string jdans = TBjd.Text.Trim();

            string str = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + questionID + "'" + " and PRUanswerUserIP='" + Request.UserHostAddress + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperResearchUserAnswer(str);
            VOPaperResearchUserAnswer objpaperuseranswerinfo = new VOPaperResearchUserAnswer();



            objpaperuseranswerinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());

            objpaperuseranswerinfo.FKPRUanswerQuestionID = int.Parse(questionID);
            objpaperuseranswerinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerinfo.PRUanswerUserAnswer = jdans;
            objpaperuseranswerinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());


            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerinfo);
            }

        }
        #endregion


        #region 更新用户试卷考试记录信息表

        VOUserPaperResearchHistory objpaperhistoryinfo = new VOUserPaperResearchHistory();

        string cmd = " FKUPRHistoryUserID=" + ViewState["UserID"].ToString() + "  and FKUPRHistoryPaperID=" + ViewState["PaperID"].ToString() + "  and UPRHistoryReadState=0  and UPRHistoryUserIP='" + Request.UserHostAddress + "'";
        int UPHID = int.Parse(objManagerPaper.QueryUserPaperResearchHistory(cmd).Rows[0]["UPRHistoryID"].ToString());
        objpaperhistoryinfo = objManagerPaper.LoadUserPaperResearchHistory(UPHID);

        objpaperhistoryinfo.UPRHistoryUpdateTime = DateTime.Now;
        objpaperhistoryinfo.UPRHistorySubmitTime= DateTime.Now;
        objManagerPaper.UpdateUserPaperResearchHistory(objpaperhistoryinfo);

        #endregion


        string url = WebUtils.WebRoot + "/sysadmin/PaperResearchManager/PaperResearchStatistical.aspx?p="+ViewState["PaperID"].ToString();

        //Script.ShowAndRedirect(Page, "提交成功，返回我的测试", url);
        if (ViewState["PaperState"].ToString() == "1")
        {
            Script.ShowMsgRedirectUrl(config.GetLanagerValueByKey("theme_Paper_Exam_Msg2", PowerCreator.LMS.Language.LanagetItemType.Page), url);
        }
        else
        {
            Script.CloseMe();
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {

        Save_Paper();
    }

    #region Web 判断题生成代码

    private void Band_dlst_panduan()
    {

        string search = " and Question.FKQuestionTypeID=1 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_panduan.Visible = false;
        }
        dlst_panduanti.DataSource = dt;
        dlst_panduanti.DataKeyField = "QuestionID";
        dlst_panduanti.DataBind();
    }
    protected void dlst_panduanti_ItemDataBound(object sender, DataListItemEventArgs e)
    {


        string QuestionID = dlst_panduanti.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;


        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)

        Label LBtx = (Label)e.Item.FindControl("LBtx");
        //if (ispanduancz == "0")
        //{
        //    ispanduancz = "1";
        //}
        //else
        //{
        //    Label LBfg = (Label)e.Item.FindControl("LBfg");         //画题目分割线
        //    LBfg.Text = "<hr noshade width='100%' size='1'>";
        //    ispanduancz = "1";
        //}

        Label LBsm1 = (Label)e.Item.FindControl("LBsm1");
        RadioButtonList answerList1 = (RadioButtonList)e.Item.FindControl("AnswerList1");
        if (answerList1 != null)
        {
            LBsm1.Text = string.Format(QEUSTIONINDEX, config.GetLanagerValueByKey("theme_Paper_Msg1", PowerCreator.LMS.Language.LanagetItemType.Page) + thi.ToString() + config.GetLanagerValueByKey("theme_Paper_Msg2", PowerCreator.LMS.Language.LanagetItemType.Page)) + QuestionContent;

            thi = thi + 1;
            BindAnswerList(answerList1, QuestionID, LBsm1);
            Label LBdantiid = (Label)e.Item.FindControl("LBdantiid");  //取得题目id
            LBdantiid.Text = QuestionID;
        }

        Label LBdanra = (Label)e.Item.FindControl("LBdanra");    //取得题目正确答案
        LBdanra.Text = dt.Rows[0]["QuestionAnswer"].ToString().Trim();

        Label lab_Score = (Label)e.Item.FindControl("lab_Score");    //取得题目分数值
        lab_Score.Text = dt.Rows[0]["QuestionDefaultScore"].ToString().Trim();

    }
    #endregion

    #region Web 单选题生成代码
    private void BindDLti1()
    {

        string search = " and Question.FKQuestionTypeID=2 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_danxuan.Visible = false;
        }
        DLti1.DataSource = dt;
        DLti1.DataKeyField = "QuestionID";
        DLti1.DataBind();
    }
    protected void DLti1_ItemDataBound(object sender, DataListItemEventArgs e)
    {

        string QuestionID = DLti1.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)

        Label LBtx = (Label)e.Item.FindControl("LBtx");

        Label LBsm1 = (Label)e.Item.FindControl("LBsm1");
        RadioButtonList answerList1 = (RadioButtonList)e.Item.FindControl("AnswerList1");
        if (answerList1 != null)
        {
            LBsm1.Text = string.Format(QEUSTIONINDEX, thi.ToString()) + QuestionContent;

            thi = thi + 1;
            BindAnswerList(answerList1, QuestionID, LBsm1);
            Label LBdantiid = (Label)e.Item.FindControl("LBdantiid");  //取得题目id
            LBdantiid.Text = QuestionID;
        }

        Label LBdanra = (Label)e.Item.FindControl("LBdanra");    //取得题目正确答案
        LBdanra.Text = dt.Rows[0]["QuestionAnswer"].ToString().Trim();

        Label lab_Score = (Label)e.Item.FindControl("lab_Score");    //取得题目分数值
        lab_Score.Text = dt.Rows[0]["QuestionDefaultScore"].ToString().Trim();


    }
    #endregion

    #region 绑定单选按钮答案

    /// <summary>
    /// 绑定单选按钮答案

    /// </summary>
    /// <param name="radioList">单选按钮集合</param>
    /// <param name="tiid">题目ID</param>
    private void BindAnswerList(RadioButtonList radioList, string QuestionID, Label lab_kongjian)
    {
        //获取用户临时保存答案
        string search = " 1=2 and FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" +Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
        DataTable dt_UserAnswerTemp = new DataTable();
        dt_UserAnswerTemp = objManagerPaper.QueryPaperResearchUserAnswer(search);

        string str = " FKQuestionOptionQuestionID =" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestionOption(str);
        radioList.DataSource = dt;
        radioList.DataTextField = "QuestionOptionContent";//答案
        radioList.DataValueField = "QuestionOptionID";//标题
        radioList.DataBind();
        ArrayList objlist = new ArrayList();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            radioList.Items[i].Text = radioList.Items[i].Text;
        }
        //根据用户临时答案赋值
        if (dt_UserAnswerTemp.Rows.Count > 0)
        {
            switch (dt_UserAnswerTemp.Rows[0]["PRUanswerUserAnswer"].ToString())
            {
                case "A":
                    radioList.Items[0].Selected = true;
                    break;
                case "B":
                    radioList.Items[1].Selected = true;
                    break;
                case "C":
                    radioList.Items[2].Selected = true;
                    break;
                case "D":
                    radioList.Items[3].Selected = true;
                    break;
                case "E":
                    radioList.Items[4].Selected = true;
                    break;
                case "F":
                    radioList.Items[5].Selected = true;
                    break;

                default:

                    break;
            }
        }
    }

    #endregion

    #region Web 多选题生成代码
    private void BindDLti2()
    {
        string search = " and Question.FKQuestionTypeID=3 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_duoxuan.Visible = false;
        }
        DLti2.DataSource = dt;
        DLti2.DataKeyField = "QuestionID";
        DLti2.DataBind();

    }

    public void DLti2_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
    {
        string QuestionID = DLti2.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)

        CheckBoxList CheckList2 = (CheckBoxList)e.Item.FindControl("CheckList2");
        if (CheckList2 != null)
        {
            Label LBsm2 = (Label)e.Item.FindControl("LBsm2");

            LBsm2.Text = string.Format(QEUSTIONINDEX, thi.ToString()) + QuestionContent;
            thi = thi + 1;
            BindCheckList(CheckList2, QuestionID, LBsm2);
            Label LBduotiid = (Label)e.Item.FindControl("LBduotiid");  //取得题目id
            LBduotiid.Text = QuestionID;
        }


        Label LBduora = (Label)e.Item.FindControl("LBduora");    //取得题目正确答案
        LBduora.Text = dt.Rows[0]["QuestionAnswer"].ToString().Trim();

        Label lab_Score = (Label)e.Item.FindControl("lab_Score");    //取得题目分数值
        lab_Score.Text = dt.Rows[0]["QuestionDefaultScore"].ToString().Trim();

    }
    #endregion

    #region 绑定多选筐答案
    /// <summary>
    /// 绑定多选筐答案
    /// </summary>
    /// <param name="checkList"> 多选筐列表</param>
    /// <param name="tiid">题目ID</param>
    private void BindCheckList(CheckBoxList checkList, string QuestionID, Label lab_kongjian)
    {
        //获取用户临时保存答案
        string search = " 1=2 and FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" + Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
        DataTable dt_UserAnswerTemp = new DataTable();
        dt_UserAnswerTemp = objManagerPaper.QueryPaperResearchUserAnswer(search);

        string str = " FKQuestionOptionQuestionID =" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestionOption(str);
        checkList.DataSource = dt;
        checkList.DataTextField = "QuestionOptionContent";//答案
        checkList.DataValueField = "QuestionOptionID";//标题
        checkList.DataBind();
        ArrayList objlist = new ArrayList();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            checkList.Items[i].Text = checkList.Items[i].Text;
        }
        //根据用户临时答案赋值
        if (dt_UserAnswerTemp.Rows.Count > 0)
        {
            string[] UserAnswerList = dt_UserAnswerTemp.Rows[0]["PRUanswerUserAnswer"].ToString().Split('$');
            for (int i = 0; i < UserAnswerList.Length; i++)
            {
                switch (UserAnswerList[i].ToString())
                {
                    case "A":
                        checkList.Items[0].Selected = true;
                        break;
                    case "B":
                        checkList.Items[1].Selected = true;
                        break;
                    case "C":
                        checkList.Items[2].Selected = true;
                        break;
                    case "D":
                        checkList.Items[3].Selected = true;
                        break;
                    case "E":
                        checkList.Items[4].Selected = true;
                        break;
                    case "F":
                        checkList.Items[5].Selected = true;
                        break;

                    default:
                        break;
                }
            }

        }

    }

    #endregion

    #region Web 填空题生成代码

    private void BindDLti3()
    {
        string search = " and Question.FKQuestionTypeID=4 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_tiankong.Visible = false;
        }
        ViewState["Question_tk_Count"] = dt.Rows.Count;
        DataTable dt_question_tk = new DataTable();
        dt_question_tk.Columns.Add("kong_count");
        string[] row = new string[1];
        row[0] = "0";
        dt_question_tk.Rows.Add(row);
        ViewState["dt_Question_tk"] = dt_question_tk;
        DLti3.DataSource = dt;
        DLti3.DataKeyField = "QuestionID";
        DLti3.DataBind();
    }

    public void DLti3_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
    {
        string QuestionID = DLti3.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

       

        //获取用户临时保存答案
        string search = " 1=2 and FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" + Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
        DataTable dt_UserAnswerTemp = new DataTable();
        dt_UserAnswerTemp = objManagerPaper.QueryPaperResearchUserAnswer(search);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)




        StringBuilder newQuestionContent = new StringBuilder();

        string[] str_QuestionContent = QuestionContent.Trim().Split('_');

        DataTable dt_question_tk = (DataTable)ViewState["dt_Question_tk"];
        dt_question_tk.Columns.Add("kong_count" + Question_tk_ID.ToString());

        dt_question_tk.Rows[0]["kong_count" + Question_tk_ID.ToString()] = str_QuestionContent.Length - 1;
        ViewState["dt_Question_tk"] = dt_question_tk;
        string[] UserAnswerList;

        if (dt_UserAnswerTemp.Rows.Count > 0)
        {
            UserAnswerList = dt_UserAnswerTemp.Rows[0]["PRUanswerUserAnswer"].ToString().Trim().Split('$');
        }
        else
        {
            UserAnswerList = new string[str_QuestionContent.Length - 1];

        }

        for (int i = 0; i < str_QuestionContent.Length; i++)
        {

            string txtvalue = "";

            if (i < str_QuestionContent.Length - 1)
            {
                if (i > UserAnswerList.Length | UserAnswerList[i] != null)
                {
                    txtvalue = UserAnswerList[i].ToString();
                }

                string textID = string.Format(NEWTEXT, "newtext_" + Question_tk_ID.ToString() + "_" + i.ToString(), txtvalue);


                newQuestionContent.Append(str_QuestionContent[i] + textID);
            }
            else
            {
                newQuestionContent.Append(str_QuestionContent[i].ToString());
            }



        }
        Label LBsmtk = (Label)e.Item.FindControl("LBsmtk");  //取得题目说明
        if (LBsmtk != null)
        {
            LBsmtk.Text = string.Format(QEUSTIONINDEX, thi.ToString()) + newQuestionContent;

            thi = thi + 1;
        }
        Question_tk_ID += 1;
        Label LBtkra = (Label)e.Item.FindControl("LBtkra");     //取得题目答案
        LBtkra.Text = dt.Rows[0]["QuestionAnswer"].ToString().Trim();
        Label lab_questionID = (Label)e.Item.FindControl("LBtktiid");   //取得题目ID
        lab_questionID.Text = QuestionID;
    }
    #endregion

    #region 名词解释
    private void BindDLti4()
    {
        string search = " and Question.FKQuestionTypeID=5 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_mingcijieshi.Visible = false;
        }
        DLti4.DataSource = dt;
        DLti4.DataKeyField = "QuestionID";
        DLti4.DataBind();
    }

    public void DLti4_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
    {
        string QuestionID = DLti4.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)

        //获取用户临时保存答案
        string search = " 1=2 and FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" + Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
        DataTable dt_UserAnswerTemp = new DataTable();
        dt_UserAnswerTemp = objManagerPaper.QueryPaperResearchUserAnswer(search);

        TextBox txt_UserAnswer = (TextBox)e.Item.FindControl("TBjd");   //获取用户答案
        if (dt_UserAnswerTemp.Rows.Count > 0)
        {
            txt_UserAnswer.Text = dt_UserAnswerTemp.Rows[0]["PRUanswerUserAnswer"].ToString();
        }



        Label LBjdftiid = (Label)e.Item.FindControl("LBjdftiid");  //取得题目id
        LBjdftiid.Text = QuestionID;

        Label LBsmjdf = (Label)e.Item.FindControl("LBsmjdf");  //取得题目说明
        if (QuestionContent != "")
        {
            LBsmjdf.Text = string.Format(QEUSTIONINDEX, thi.ToString()) + QuestionContent;

            thi = thi + 1;
        }
    }
    #endregion

    #region Web 简答

    private void BindDLti5()
    {
        string search = " and Question.FKQuestionTypeID=6 and PaperResearchQuestion.FKPRQuestionPaperID=" + ViewState["PaperID"].ToString();
        DataTable dt = objManagerPaper.GetPaperResearchQuestionList(search);
        if (dt.Rows.Count == 0)
        {
            pn_jiandati.Visible = false;
        }
        DLti5.DataSource = dt;
        DLti5.DataKeyField = "QuestionID";
        DLti5.DataBind();

    }

    public void DLti5_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
    {
        string QuestionID = DLti5.DataKeys[e.Item.ItemIndex].ToString().Trim();//获取题号
        string str = " QuestionID=" + QuestionID;
        DataTable dt = objManagerQuestion.QueryQuestion(str);//根据题号从题库获取列表

        DataTable dt_PaperQuestion = objManagerPaper.QueryPaperResearchQuestion(" FKPRQuestionPaperID=" + ViewState["PaperID"].ToString() + " and FKPRQuestionQuesID=" + QuestionID);

        string QuestionContent = dt_PaperQuestion.Rows[0]["PRQuestionContent"].ToString();//获取问题名字(从试卷试题表中获取)

        //获取用户临时保存答案
        string search = " 1=2 and FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" + Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
        DataTable dt_UserAnswerTemp = new DataTable();
        dt_UserAnswerTemp = objManagerPaper.QueryPaperResearchUserAnswer(search);

        TextBox txt_UserAnswer = (TextBox)e.Item.FindControl("TBjd");   //获取用户答案
        if (dt_UserAnswerTemp.Rows.Count > 0)
        {
            txt_UserAnswer.Text = dt_UserAnswerTemp.Rows[0]["PRUanswerUserAnswer"].ToString();
        }


        Label LBjdftiid = (Label)e.Item.FindControl("LBjdftiid");  //取得题目id
        LBjdftiid.Text = QuestionID;

        Label LBsmjdf = (Label)e.Item.FindControl("LBsmjdf");  //取得题目说明

        LBsmjdf.Text = string.Format(QEUSTIONINDEX, thi.ToString()) + QuestionContent;

        thi = thi + 1;
    }
    #endregion

    #region 检查判断题完成情况
    private bool Check_Panduanti()
    {
        foreach (DataListItem sDataListItem in dlst_panduanti.Items)
        {
            bool isnull = false;
            RadioButtonList rbtl = (RadioButtonList)sDataListItem.FindControl("AnswerList1");
            for (int i = 0; i < rbtl.Items.Count; i++)
            {
                if (rbtl.Items[i].Selected == true)
                    isnull = true;
            }
            if (!isnull)
            {
                return isnull;
            }
        }
        return true;
    }
    #endregion

    #region 检查单选题完成情况
    private bool Check_danxuanti()
    {
        foreach (DataListItem sDataListItem in DLti1.Items)
        {
            bool isnull = false;
            RadioButtonList rbtl = (RadioButtonList)sDataListItem.FindControl("AnswerList1");
            for (int i = 0; i < rbtl.Items.Count; i++)
            {
                if (rbtl.Items[i].Selected == true)
                    isnull = true;
            }
            if (!isnull)
            {
                return isnull;
            }
        }
        return true;
    }
    #endregion

    #region 检查多选题完成情况
    private bool Check_duoxuanti()
    {
        foreach (DataListItem pDataListItem in DLti2.Items)
        {
            bool isnull = false;
            CheckBoxList objchboxlst = (CheckBoxList)pDataListItem.FindControl("CheckList2");
            for (int i = 0; i < objchboxlst.Items.Count; i++)
            {
                if (objchboxlst.Items[i].Selected == true)
                    isnull = true;
            }
            if (!isnull)
            {
                return isnull;
            }
        }
        return true;
    }
    #endregion

    #region 检查填空题完成情况
    /*
    private bool Check_Tiank()
    {
        int questioncount = 1;
        bool Check = true;
        foreach (DataListItem qDataListItem in DLti3.Items)
        {
            Label LBtktiid = (Label)qDataListItem.FindControl("LBtktiid");
            string QuestionID = LBtktiid.Text.Trim();


            StringBuilder UserAnswer = new StringBuilder();
            DataTable dt_question_tk = (DataTable)ViewState["dt_Question_tk"];
            int kongCount = int.Parse(dt_question_tk.Rows[0][questioncount].ToString());
            for (int i = 0; i < kongCount; i++)
            {
                string question_tk_ID = "newtext" + "_" + questioncount + "_" + i;
                if (Request.Params[question_tk_ID].ToString().Trim() == "")
                {
                    Check = false;
                }
                if (i < kongCount - 1)
                {

                    UserAnswer.Append(Request.Params[question_tk_ID].ToString() + "$");
                }
                else
                {
                    UserAnswer.Append(Request.Params[question_tk_ID].ToString());
                }
            }
            string str_check = UserAnswer.ToString();
            if (string.IsNullOrEmpty(str_check.Replace("$", "").ToString()))
            {

                break;
            }
            questioncount += 1;
            Label LBtkra = (Label)qDataListItem.FindControl("LBtkra");
            string rightans = LBtkra.Text.Trim();

            string search = " FKPRUanswerUserID='" + ViewState["UserID"].ToString() + "'  and PRUanswerUserIP='" + Request.UserHostAddress + "' and FKPRUanswerPaperID='" + ViewState["PaperID"].ToString() + "' and FKPRUanswerQuestionID='" + QuestionID + "'";
            DataTable dt = new DataTable();
            dt = objManagerPaper.QueryPaperUserAnswerTemp(str);
            VOPaperResearchUserAnswer objpaperuseranswerTempinfo = new VOPaperResearchUserAnswer();




            objpaperuseranswerTempinfo.PRUanswerUserIP = Request.UserHostAddress;
            objpaperuseranswerTempinfo.FKPRUanswerPaperID = int.Parse(ViewState["PaperID"].ToString());
            objpaperuseranswerTempinfo.FKPUAtempProjectID = int.Parse(ViewState["ProjectID"].ToString());
            objpaperuseranswerTempinfo.FKPRUanswerQuestionID = int.Parse(QuestionID);

            objpaperuseranswerTempinfo.PRUanswerUserAnswer = UserAnswer.ToString();
            objpaperuseranswerTempinfo.FKPRUanswerUserID = int.Parse(ViewState["UserID"].ToString());
            if (dt.Rows.Count > 0)
            {
                objpaperuseranswerTempinfo.PRUanswerID = int.Parse(dt.Rows[0]["PRUanswerID"].ToString());
                objManagerPaper.UpdatePaperResearchQuestionTemp(objpaperuseranswerTempinfo);
            }
            else
            {
                objManagerPaper.CreatePaperResearchUserAnswer(objpaperuseranswerTempinfo);
            }

        }
        return Check;
    }

     * */
    #endregion



    #region 检查名词解释题完成情况
    private bool Check_mingcijieshi()
    {
        foreach (DataListItem rDataListItem in DLti4.Items)
        {
            TextBox TBjd = (TextBox)rDataListItem.FindControl("TBjd");
            string jdans = TBjd.Text.Trim();
            if (string.IsNullOrEmpty(jdans))
            {
                return false;
            }

        }
        return true;
    }
    #endregion

    #region 检查简答题完成情况
    private bool Check_jiandati()
    {
        foreach (DataListItem rDataListItem in DLti5.Items)
        {
            TextBox TBjd = (TextBox)rDataListItem.FindControl("TBjd");
            string jdans = TBjd.Text.Trim();
            if (string.IsNullOrEmpty(jdans))
            {
                return false;
            }

        }
        return true;
    }
    #endregion


    protected void btn_Check_Click(object sender, EventArgs e)
    {

        if (!Check_Panduanti())
        {
            Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg3", PowerCreator.LMS.Language.LanagetItemType.Page));
            BindDLti3();
            return;
        }
        if (!Check_danxuanti())
        {
            Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg4", PowerCreator.LMS.Language.LanagetItemType.Page));
            BindDLti3();
            return;
        }
        //if (!Check_Tiank())
        //{
        //    Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg5", PowerCreator.LMS.Language.LanagetItemType.Page));
        //    BindDLti3();
        //    return;
        //}
        if (!Check_duoxuanti())
        {
            Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg6", PowerCreator.LMS.Language.LanagetItemType.Page));
            BindDLti3();
            return;
        }
        if (!Check_mingcijieshi())
        {
            Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg7", PowerCreator.LMS.Language.LanagetItemType.Page));
            BindDLti3();
            return;
        }
        if (!Check_jiandati())
        {
            Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg8", PowerCreator.LMS.Language.LanagetItemType.Page));
            BindDLti3();
            return;
        }

        BindDLti3();
        Script.Alert(Page, "msg", config.GetLanagerValueByKey("theme_Paper_Exam_Msg9", PowerCreator.LMS.Language.LanagetItemType.Page));
    }

}
